package Demo;

public class runtime {
    public static void main(String[] args) throws Exception {
        Runtime run = Runtime.getRuntime();
        System.out.println(run.availableProcessors());
        System.out.println("total=" + run.totalMemory());
        System.out.println("free=" + run.freeMemory());
        for (int i = 0; i <Integer.MAX_VALUE ; i++) {
            ;
        }
        System.out.println();
        System.out.println("total=" + run.totalMemory());
        System.out.println("free=" + run.freeMemory());
        System.out.println();
        run.gc();
        System.out.println("total=" + run.totalMemory());
        System.out.println("free=" + run.freeMemory());
    }
}
